﻿<ccl:CustomChromeWindow x:Class="WPFVarTab.MainWindow"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:behavior="clr-namespace:JFKCommonLibrary.WPF.Converters;assembly=JFKCommonLibrary"
                        xmlns:ccl="clr-namespace:CustomChromeLibrary;assembly=CustomChromeLibrary"
                        xmlns:DataTypes="clr-namespace:DotNetSiemensPLCToolBoxLibrary.DataTypes;assembly=DotNetSiemensPLCToolBoxLibrary"
                        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
                        xmlns:Shell="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
                        xmlns:System="clr-namespace:System;assembly=mscorlib"
                        xmlns:WPFVarTab="clr-namespace:WPFVarTab"
                        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                        xmlns:Properties="clr-namespace:WPFVarTab.Properties"
                        xmlns:wpf="clr-namespace:JFKCommonLibrary.WPF;assembly=JFKCommonLibrary" Name="ThisWindow"
                        Title="JFK-WPF-VarTab"
                        Width="784"
                        Height="397"
                        MinWidth="200"
                        MinHeight="100"
                        Icon="/WPFVarTab;component/Images/go-home-6.png"
                        ResizeMode="CanResizeWithGrip"
                        Style="{DynamicResource GlassStyle}"
                        WindowStyle="None" Closing="ThisWindow_Closing">

    <Window.CommandBindings>
        <CommandBinding Command="{x:Static Shell:SystemCommands.ShowSystemMenuCommand}" Executed="_OnShowSystemMenuCommand" />
        <CommandBinding Command="{x:Static Shell:SystemCommands.CloseWindowCommand}" Executed="_OnSystemCommandCloseWindow" />
    </Window.CommandBindings>

    <Window.Resources>
        <Style TargetType="{x:Type DataGridCell}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                        <Grid Background="{TemplateBinding Background}">
                            <ContentPresenter VerticalAlignment="Center" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <LinearGradientBrush x:Key="CheckedBlue" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#FF285AB3" Offset="0" />
            <GradientStop Color="#FF4184EC" Offset="0.5" />
            <GradientStop Color="#FF558BED" Offset="0.5" />
            <GradientStop Color="#FF7DACF0" Offset="1" />
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="CheckedOrange" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#FFCA6A13" Offset="0" />
            <GradientStop Color="#FFF67D0C" Offset="0.2" />
            <GradientStop Color="#FFFE7F0C" Offset="0.2" />
            <GradientStop Color="#FFFA8E12" Offset="0.5" />
            <GradientStop Color="#FFFF981D" Offset="0.5" />
            <GradientStop Color="#FFFCBC5A" Offset="1" />
        </LinearGradientBrush>
        <SolidColorBrush x:Key="CheckedOrangeBorder" Color="#FF8E4A1B" />
        <SolidColorBrush x:Key="CheckedBlueBorder" Color="#FF143874" />
        <Style TargetType="{x:Type CheckBox}">
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type CheckBox}">
                        <ControlTemplate.Resources>
                            <Storyboard x:Key="OnChecking">
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="slider" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="53" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                            <Storyboard x:Key="OnUnchecking">
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="slider" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </ControlTemplate.Resources>
                        <DockPanel x:Name="dockPanel">
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" RecognizesAccessKey="True" VerticalAlignment="Center" />
                            <Grid>
                                <Border x:Name="BackgroundBorder" BorderBrush="#FF939393" BorderThickness="1" CornerRadius="3" Height="27" Width="94">
                                    <Border.Background>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                            <GradientStop Color="#FFB5B5B5" Offset="0" />
                                            <GradientStop Color="#FFDEDEDE" Offset="0.1" />
                                            <GradientStop Color="#FFEEEEEE" Offset="0.5" />
                                            <GradientStop Color="#FFFAFAFA" Offset="0.5" />
                                            <GradientStop Color="#FFFEFEFE" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Ellipse x:Name="Off" Width="14" Height="14" Stroke="#FF7A7A7A" StrokeThickness="2" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                        <Line x:Name="On" X1="0" Y1="0" X2="0" Y2="14" Stroke="#FF7A7A7A" StrokeThickness="2" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                    </Grid>
                                </Border>
                                <Border BorderBrush="#FF939393" HorizontalAlignment="Left" x:Name="slider" Width="41" Height="27" BorderThickness="1" CornerRadius="3" RenderTransformOrigin="0.5,0.5" Margin="0">
                                    <Border.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform ScaleX="1" ScaleY="1" />
                                            <SkewTransform AngleX="0" AngleY="0" />
                                            <RotateTransform Angle="0" />
                                            <TranslateTransform X="0" Y="0" />
                                        </TransformGroup>
                                    </Border.RenderTransform>
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="#FFF0F0F0" Offset="0" />
                                            <GradientStop Color="#FFCDCDCD" Offset="0.1" />
                                            <GradientStop Color="#FFFBFBFB" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                            </Grid>
                        </DockPanel>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                                <Trigger.ExitActions>
                                    <BeginStoryboard Storyboard="{StaticResource OnUnchecking}" x:Name="OnUnchecking_BeginStoryboard" />
                                </Trigger.ExitActions>
                                <Trigger.EnterActions>
                                    <BeginStoryboard Storyboard="{StaticResource OnChecking}" x:Name="OnChecking_BeginStoryboard" />
                                </Trigger.EnterActions>
                                <Setter TargetName="On" Property="Stroke" Value="White" />
                                <Setter TargetName="Off" Property="Stroke" Value="White" />
                                <!-- Change Orange or Blue color here -->
                                <Setter TargetName="BackgroundBorder" Property="Background" Value="{StaticResource CheckedBlue}" />
                                <Setter TargetName="BackgroundBorder" Property="BorderBrush" Value="{StaticResource CheckedBlueBorder}" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <!-- ToDo: Add Style for Isenabled == False -->
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <behavior:NullableBoolToBrushConverter x:Key="connectedConv"
                                               FalseValue="Red"
                                               NullValue="Transparent"
                                               TrueValue="LightGreen" />
        <behavior:NullableBoolToBrushConverter x:Key="connectedConv2"
                                               FalseValue="Red"
                                               NullValue="Transparent"
                                               TrueValue="LightGreen" />

        <ObjectDataProvider x:Key="resTagDataTypes"
                            MethodName="GetValues"
                            ObjectType="{x:Type System:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="DataTypes:TagDataType" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

        <ObjectDataProvider x:Key="resTagDisplayDataTypes"
                            MethodName="GetValues"
                            ObjectType="{x:Type System:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="DataTypes:TagDisplayDataType" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

        <DataTemplate x:Key="commentTemplate">
            <TextBlock Text="{Binding}" />
        </DataTemplate>

        <DataTemplate x:Key="normalTemplate">
            <Image Source="{Binding }" />
        </DataTemplate>

        <WPFVarTab:VarTabRowItemTemplateSelector x:Key="vartabrowItemTemplateSelector"
                                                 CommentRowsTemplate="{StaticResource commentTemplate}"
                                                 NormalRowsTemplate="{StaticResource normalTemplate}" />

        <Style TargetType="{x:Type DataGridCellsPresenter}">
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <WPFVarTab:CustomDataGridCellsPanel IsItemsHost="True" />
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="GlassStyle" TargetType="{x:Type WPFVarTab:MainWindow}">
            <Setter Property="Shell:WindowChrome.WindowChrome">
                <Setter.Value>
                    <Shell:WindowChrome CaptionHeight="36"
                                        GlassFrameThickness="-1"
                                        ResizeBorderThickness="4" />
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type WPFVarTab:MainWindow}">
                        <Grid>
                            <ContentPresenter Margin="7,14,7,7" Content="{TemplateBinding Content}" />
                            <WrapPanel Height="35"
                                       Margin="0,0,114,0"
                                       VerticalAlignment="Top"
                                       Orientation="Horizontal">
                                <Button Margin="7,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Command="{x:Static Shell:SystemCommands.ShowSystemMenuCommand}"
                                        CommandParameter="{Binding ElementName=ThisWindow}"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True">
                                    <Image Width="16"
                                           Height="16"
                                           Source="{Binding RelativeSource={RelativeSource TemplatedParent},
                                                            Path=Icon}" />
                                </Button>
                                <Button Name="cmdNew"
                                        Margin="20,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Click="cmdNew_Click"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                        ToolTip="New VarTab">
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/document-new.png" />
                                </Button>
                                <Button Name="cmdOpen"
                                        Margin="2,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Click="cmdOpen_Click"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                        ToolTip="Open an existing VarTab">
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/document-open-4.png" />
                                </Button>

                                <Button Name="cmdSave"
                                        Margin="2,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Click="cmdSave_Click"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                        ToolTip="Save VarTab">
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/document-export.png" />
                                </Button>
                                <Button Name="cmdConfigConnection"
                                        Margin="2,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Click="cmdConfigConnection_Click"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                        ToolTip="Config Connections">
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/configure-2.png" />
                                </Button>
                                <ToggleButton Name="cmdOnlineView"
                                              Margin="2,7,0,2"
                                              HorizontalAlignment="Left"
                                              VerticalAlignment="Top"
                                              Click="cmdOnlineView_Click"
                                              Padding="3"
                                              Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                              ToolTip="Online View">
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/zoom-3.png" />
                                </ToggleButton>
                                <Button Name="cmdControlValues"                                        
                                        Margin="2,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Click="cmdControlValues_Click"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                        ToolTip="Control Values">
                                    <Button.Visibility>
                                        <Binding Path="AllowTagsControl" Source="{x:Static Properties:Settings.Default}">
                                            <Binding.Converter>
                                                <behavior:BoolToVisibilityConverter></behavior:BoolToVisibilityConverter>
                                            </Binding.Converter>
                                        </Binding>                                        
                                    </Button.Visibility>
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/draw-line-2.png" />
                                </Button>
                                <Button Name="cmdConfigVarTab"
                                        Margin="2,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Click="cmdConfigVarTab_Click"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                        ToolTip="VarTab Options">
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/configure-shortcuts.png" />
                                </Button>
                                <Button Name="cmdImportVarTab"
                                        Margin="2,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Click="cmdImportVarTab_Click"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                        ToolTip="Import Step7 VarTab">
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/import.png" />
                                </Button>
                                <Button Name="cmdSetSymbolTabels"
                                        Margin="2,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Click="cmdSetSymbolTabels_Click"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                        ToolTip="Select Symbol Tables">
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/import2.png" />
                                </Button>
                                <ComboBox Height="26"
                                          MinWidth="160"
                                          Margin="7,7,0,2"
                                          HorizontalAlignment="Stretch"
                                          VerticalAlignment="Top"
                                          HorizontalContentAlignment="Stretch"
                                          VerticalContentAlignment="Center"
                                          ItemsSource="{Binding ConnectionDictionary}"
                                          Padding="3"
                                          SelectedItem="{Binding DefaultConnectionEntry}"
                                          Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                          ToolTip="Default Connection"
                                          WPFVarTab:ComboBoxExtension.IsNullable="True">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Ellipse Width="16"
                                     Height="16"
                                     Fill="{Binding Value.Connected,Converter={StaticResource connectedConv2},FallbackValue=Transparent}" />
                                                    <TextBlock Text="{Binding Value.Name}" />
                                             </StackPanel>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                                <Button Name="cmdExportAllConnections"
                                        Margin="2,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Click="cmdExportAllConnections_Click"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                        ToolTip="Export All Connections">
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/export3.png" />
                                </Button>
                                <Button Name="cmdImportAllConnections"
                                        Margin="2,7,0,2"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top"
                                        Click="cmdImportAllConnections_Click"
                                        Padding="3"
                                        Shell:WindowChrome.IsHitTestVisibleInChrome="True"
                                        ToolTip="Import All Connections">
                                    <Image Width="16"
                                           Height="16"
                                           Source="/WPFVarTab;component/Images/import3.png" />
                                </Button>
                            </WrapPanel>

                            <ccl:CaptionButtons />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>


        <WPFVarTab:CustomDataGrid x:Name="dataGrid"
                                  Grid.RowSpan="2"
                                  Margin="0,22,0,22"
                                  AlternatingRowBackground="LightSteelBlue"
                                  AutoGenerateColumns="False"
                                  CanUserAddRows="True"
                                  CanUserDeleteRows="True"
                                  CanUserResizeRows="False"
                                  CanUserSortColumns="False"
                                  CellEditEnding="dataGrid_CellEditEnding"
                                  ItemTemplateSelector="{StaticResource vartabrowItemTemplateSelector}"
                                  KeyDown="dataGrid_KeyDown"
                                  RowBackground="Azure">
            <WPFVarTab:CustomDataGrid.ContextMenu>
                <ContextMenu>
                    <MenuItem>
                        <MenuItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock VerticalAlignment="Center" Text="Add " />
                                <xctk:IntegerUpDown Name="numberOfRows"
                                                    Width="40"
                                                    VerticalAlignment="Center"
                                                    Maximum="100"
                                                    Minimum="1"
                                                    Value="1" />
                                <TextBlock VerticalAlignment="Center" Text=" Rows" />
                                <Button Name="cmdAddNumberOfRows"
                                        Margin="5,0,0,0"
                                        VerticalAlignment="Center"
                                        Click="cmdAddNumberOfRows_Click">
                                    Ok
                                </Button>
                            </StackPanel>
                        </MenuItem.Header>
                    </MenuItem>
                </ContextMenu>
            </WPFVarTab:CustomDataGrid.ContextMenu>
            <WPFVarTab:CustomDataGrid.Columns>
                <DataGridTemplateColumn>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Ellipse Width="16"
                                     Height="16"
                                     Fill="{Binding Connected,
                                                    Converter={StaticResource connectedConv},
                                                    FallbackValue=Red}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

                <DataGridTextColumn Binding="{Binding S7FormatAddress, Mode=TwoWay}" Header="Address" />
                <DataGridTextColumn Binding="{Binding Symbol}"
                                    Header="Symbol"
                                    IsReadOnly="True" />
                <!--  <DataGridTextColumn Binding="{Binding LibNoDaveValue.TagDataType}" Header="DataType"></DataGridTextColumn>  -->
                <DataGridComboBoxColumn Header="DataType"
                                        ItemsSource="{Binding Source={StaticResource resTagDataTypes}}"
                                        SelectedItemBinding="{Binding TagDataType,
                                                                      Mode=TwoWay}" />
                <!--  <DataGridTextColumn Binding="{Binding LibNoDaveValue.DataTypeStringFormat}" Header="DisplayFormat"></DataGridTextColumn>  -->
                <DataGridComboBoxColumn Header="DisplayFormat"
                                        ItemsSource="{Binding Source={StaticResource resTagDisplayDataTypes}}"
                                        SelectedItemBinding="{Binding DataTypeStringFormat,
                                                                      Mode=TwoWay}" />

                <DataGridTextColumn Binding="{Binding ArraySize, Mode=TwoWay}" Header="ArraySize" />
                
                <DataGridTemplateColumn Width="170" Header="Connection">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                               
                                   <Ellipse Width="16"
                                     Height="16"
                                     Fill="{Binding Connected,Converter={StaticResource connectedConv2},FallbackValue=Transparent}" />
                                <TextBlock Text="{Binding ConnectionName}" />
                            </StackPanel>
                           
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                    <DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <ComboBox Foreground="Black"
                                      ItemsSource="{Binding ElementName=ThisWindow,
                                                            Mode=TwoWay,
                                                            Path=Connections}"
                                      SelectedItem="{Binding ConnectionName}"
                                      WPFVarTab:ComboBoxExtension.IsNullable="True">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger>
                                        <wpf:ResolveElementName PropertyName="ItemsSource" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </ComboBox>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellEditingTemplate>
                </DataGridTemplateColumn>
                <!--<DataGridTextColumn Binding="{Binding LibNoDaveValue.ValueAsString}"
                                    Header="Value"
                                    IsReadOnly="True" />-->
                <DataGridTemplateColumn Header="Value">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <ContentControl Content="{Binding ValueAsUI}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Binding="{Binding ControlValueAsString}" Header="ControlValue" />
                <DataGridTextColumn Binding="{Binding Comment}" Header="Comment" />
            </WPFVarTab:CustomDataGrid.Columns>
        </WPFVarTab:CustomDataGrid>
        <StatusBar Name="statusBar"
                   Grid.Row="1"
                   Height="22"
                   VerticalAlignment="Bottom"
                   HorizontalContentAlignment="Stretch"
                   Opacity="0.5">
            <StatusBarItem Width="120"
                           HorizontalAlignment="Right"
                           DockPanel.Dock="Right">
                <Label Content="JFK-WPFVarTab 1.2" Padding="0" />
            </StatusBarItem>
            <StatusBarItem VerticalContentAlignment="Stretch" DockPanel.Dock="Right">
                <ProgressBar Name="ProgressBarOnlineStatus"
                             Width="50"
                             VerticalAlignment="Stretch"
                             IsIndeterminate="False"
                             Value="0" />
            </StatusBarItem>
            <StatusBarItem HorizontalAlignment="Stretch"
                           HorizontalContentAlignment="Stretch"
                           VerticalContentAlignment="Stretch">
                <Label Name="lblStatus" Padding="0" />
            </StatusBarItem>
        </StatusBar>
    </Grid>
</ccl:CustomChromeWindow>
